package com.yanqu.road.entity.language;

import java.util.Objects;

public class LanguageType {
    public static final String LANGUAGE_DEFAULT = "zh_cn";
    public static final String LANGUAGE_TW = "zh_tw";
    public static final String LANGUAGE_ZH_CM = "zh_cm";
    public static final String LANGUAGE_EN_US = "en_us";
    public static final String LANGUAGE_TH_TH = "th_th";
    public static final String LANGUAGE_VN = "vi_vn";
    public static final String LANGUAGE_KO_KR = "ko_kr";
    public static final String LANGUAGE_JA_JP = "ja_jp";            //日语
    public static final String LANGUAGE_RU_RU = "ru_ru";            //俄语

    public static final String PLATFORM_LANGUAGE_ZH_CN = "zh-CN";   //简体中文
    public static final String PLATFORM_LANGUAGE_ZH_TW = "zh-TW";   //繁體中文
    public static final String PLATFORM_LANGUAGE_JA_JP = "ja-JP";   //日本語
    public static final String PLATFORM_LANGUAGE_TH_TH = "th-TH";   //
    public static final String PLATFORM_LANGUAGE_KO_KR = "ko-KR";   //韩国
    public static final String PLATFORM_LANGUAGE_DE_DE = "de-DE";   //
    public static final String PLATFORM_LANGUAGE_EN_US = "en-US";   //
    public static final String PLATFORM_LANGUAGE_ES_ES = "es-ES";   //
    public static final String PLATFORM_LANGUAGE_FR_FR = "fr-FR";   //
    public static final String PLATFORM_LANGUAGE_PT_PT = "pt-PT";   //
    public static final String PLATFORM_LANGUAGE_RU_RU = "ru-RU";   //
    public static final String PLATFORM_LANGUAGE_TR_TR = "tr-TR";   //
    public static final String PLATFORM_LANGUAGE_VI_VN = "vi-VN";   //
    public static final String PLATFORM_LANGUAGE_IT_IT = "it-IT";   //

    public static String platformLanguageMapping(String platformLanguage, String userLanguage){
        if(Objects.equals(LANGUAGE_TW, platformLanguage)){
            return LANGUAGE_TW;
        }else if(Objects.equals(LANGUAGE_DEFAULT, platformLanguage)){
            return LANGUAGE_DEFAULT;
        }else if(Objects.equals(PLATFORM_LANGUAGE_ZH_CN, platformLanguage)){
            return LANGUAGE_ZH_CM;
        }else if(Objects.equals(PLATFORM_LANGUAGE_ZH_TW, platformLanguage)){
            return LANGUAGE_TW;
        }else if(Objects.equals(PLATFORM_LANGUAGE_JA_JP, platformLanguage)){
            return LANGUAGE_JA_JP;
        }else if(Objects.equals(PLATFORM_LANGUAGE_TH_TH, platformLanguage)){
            return LANGUAGE_TH_TH;
        }else if(Objects.equals(PLATFORM_LANGUAGE_KO_KR, platformLanguage)){
            return LANGUAGE_KO_KR;
        }else if(Objects.equals(PLATFORM_LANGUAGE_DE_DE, platformLanguage)){
            return LANGUAGE_EN_US;
        }else if(Objects.equals(PLATFORM_LANGUAGE_EN_US, platformLanguage)){
            return LANGUAGE_EN_US;
        }else if(Objects.equals(PLATFORM_LANGUAGE_ES_ES, platformLanguage)){
            return LANGUAGE_EN_US;
        }else if(Objects.equals(PLATFORM_LANGUAGE_FR_FR, platformLanguage)){
            return LANGUAGE_EN_US;
        }else if(Objects.equals(PLATFORM_LANGUAGE_PT_PT, platformLanguage)){
            return LANGUAGE_EN_US;
        }else if(Objects.equals(PLATFORM_LANGUAGE_RU_RU, platformLanguage)){
            return LANGUAGE_EN_US;
        }else if(Objects.equals(PLATFORM_LANGUAGE_TR_TR, platformLanguage)){
            return LANGUAGE_EN_US;
        }else if(Objects.equals(PLATFORM_LANGUAGE_VI_VN, platformLanguage)){
            return LANGUAGE_VN;
        }else if(Objects.equals(PLATFORM_LANGUAGE_IT_IT, platformLanguage)){
            return LANGUAGE_EN_US;
        }
        return userLanguage;
    }
}
